﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FriendAD.Core
{
   public class Ad
    {
        public Ad()
        {
            Link = "http://";
            Infos = new List<Info>();
            isDel = false;
        }
        [Key]
        public int AdID { set; get; }
        public int UserId { set; get; }
        [Display(Name ="广告名")]
        [Required(ErrorMessage =("请输入{0}"))]
        [StringLength(30,MinimumLength =2,ErrorMessage ="{2}到{1}个字符")]
        public string Title { set; get; }
        [Display(Name ="广告图片")]
        [Required(ErrorMessage ="请选择{0}")]
        [DataType(DataType.Upload)]
        public string Img { set; get; }
        [Display(Name ="广告链接")]
        [DataType(DataType.Url)]
        public string Link { set; get; }
        [Display(Name ="联系电话")]
        public string tell { set; get; }
        [Display(Name ="二维码")]
        [DataType(DataType.ImageUrl)]
        public string Qrcode { set; get; }
        /// <summary>
        /// 广告软删除
        /// </summary>
        public bool isDel { set; get; }

        public virtual ICollection<Info> Infos { set; get; }
    }
}
